package com.zhiyou100.crm.service.impl;

import com.zhiyou100.crm.dao.CustomerCategoryDao;
import com.zhiyou100.crm.service.CustomerCategoryService;
import com.zhiyou100.crm.pojo.CustomerCategory;
import com.zhiyou100.crm.util.S_session;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.io.IOException;
import java.util.List;
@Service("customerCategoryServiceImpl")
public class CustomerCategoryServiceImpl implements CustomerCategoryService {
//    CustomerCategoryDao customerCategoryDao=new CustomerCategoryDaoImpl();
    @Autowired
    private CustomerCategoryDao customerCategoryDao;

    @Override
    public List<CustomerCategory> queryAll() throws IOException {
        List<CustomerCategory> customerCategories = customerCategoryDao.queryAll();
        return customerCategories;
    }

    @Override
    public int update(CustomerCategory category) throws IOException {
        int a =customerCategoryDao.update(category);
        return a;
    }

    @Override
    public int delete(int id) throws IOException {
        int a = customerCategoryDao.delete(id);
        return a;
    }
}
